Skip to content

Conversation

@ByteAlex
Copy link
Owner

@ByteAlex ByteAlex commented Dec 4, 2021

Instead of forcing context-switches with block_in_place when the tokio-runtime feature was enabled, we spawn a dedicated thread for the decompression and use std lib to send data over to the dedicated thread, handle decompression there and send the result back via a future oneshot channel.
This channel can be polled in a nested context from the ZlibStream implementation.

This PR is a replacement for the tokio-runtime feature in it's functionality, but the tokio-runtime feature is still available to use tokio::spawn_blocking for blocking tasks, instead of starting an own thread.
To enable the features from this PR, enable the thread feature flag.

@ByteAlex
Copy link
Owner Author

ByteAlex commented Dec 4, 2021

Formatting is a mess; I'm on my mac and I don't have my rustfmt updated... Fixing soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant